#pragma once
#include "RollbackAction.h"
#include "WarningStrategyChain.h"

class CWarnAction :	public IActionItem
{
	Q_OBJECT;
private:
	QString m_author;
	QString m_page;
	CWarningStrategyChain *rollbackChain;
	CRollbackAction m_rollback;
signals:
	void RollbackSucceeded(unsigned int diff);
	void RollbackFailed(unsigned int diff, QString errorCode, QString errorMessage);
	void EventPosted(CLoggedEvent* event);
public slots:
	void EmitRollbackSucceeded(unsigned int diff);
	void EmitRollbackFailed(unsigned int diff, QString errorCode, QString errorMessage);
	void EmitEventPosted(CLoggedEvent* event);

public:
	inline bool ExecuteRollback() { return m_rollback.Run(); };
	virtual bool Complete() { return true; };
	virtual bool Run();
	CWarnAction(unsigned int diff, QString page, QString author);
	virtual ~CWarnAction(void);
};
